import { LoveTaskRadioBtn } from "../LoveTaskRadioBtn";
import { GTextFormat } from "../../../../common/GTextFormat";
import { FontUtil } from "../../../../common/font/FontUtil";
import { ObjCreate } from "../../common/ObjCreate";
import { LoveTaskGiveItemInfo } from "../../../model/loveTask/LoveTaskGiveItemInfo";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
//class LoveTaskGiveItem
    
    export  class LoveTaskGiveItem extends LoveTaskRadioBtn
    {
        constructor()
        {
            super();
            return;
        }

        protected /* override */ initUI(): void
        {
            super.initUI();
            var loc1=new GTextFormat(FontUtil.songtiName, 12, 16776960);
            loc1.leading = 2;
            this._costTxt = ObjCreate.createGTextField("", _radioTxt.x + 85, _radioTxt.y, 335, 40, this, loc1);
            this._costTxt.textColor = 16776960;
            this._costTxt.wordWrap = true;
            this._costTxt.multiline = true;
            this._costTxt.mouseWheelEnabled = false;
            this._costTxt.addEventListener(flash.events.MouseEvent.CLICK, onRadioTxtClickHandler);
            return;
        }

        public /* override */ updateData(arg1: Object): void
        {
            super.updateData(arg1);
            _radioTxt.htmlText = (data as LoveTaskGiveItemInfo).itemName;
            this._costTxt.x = _radioTxt.x + _radioTxt.textWidth + 5;
            this._costTxt.width = 420 - _radioTxt.textWidth;
            this._costTxt.text = (data as LoveTaskGiveItemInfo).itemCost;
            _radioTxt.toolTipData = (data as LoveTaskGiveItemInfo).itemData.getToolTipData();
            return;
        }

        public /* override */ get height(): number
        {
            return this._costTxt.textHeight + 12;
        }

        protected /* var */_costTxt: GTextFiled;
    }
